<?php
	
//include "includes".DIRECTORY_SEPARATOR."include_user_manufacturer_functions.php";
include "includes".DIRECTORY_SEPARATOR."javascript".DIRECTORY_SEPARATOR."serverside.php";
echo "Test file"."<br>" ;

function getRegionTest(){
	echo "<tr><td>getRegion </td>";
	
	$test = 1;
	
	if (getRegion("Dolj ") != "Sud-Vest - Oltenia")
		$test = 0 ;
	/*	
	if (getRegion(" Olt ") != "Sud-Vest - Oltenia")
		$test = 0 ;
		*/
			
	if ($test == 1)	
		echo "<td><p style='color:green'>Pass</p></td>";
	else
		echo "<td><p style='color:green'>Fail</p></td>";
	echo "</tr>" ;
}


#validation function for only numbers regex
function isNr($nr){
	if( preg_match('/^[0-9]*$/', $nr))
    	return 1;
	else 
    	return 0;
}

#validation function for date regex YYYY-MM-DD
function isDate($date){
	if( preg_match('/^[1-2][0-9]{3}-(0[1-9]|10|11|12)-(0[1-9]|[1-2][0-9]|3[0-1])$/', $date))
    	return 1;
	else 
    	return 0;
}


#dateLTEToday("2013-04-20");


# validation for CUI /CF function 
echo "<table border='0'>" ;
getRegionTest();
echo "</table>"; 
/*
echo "CUI 0:".validate_cui("M178903")."<br>";

# validation for CUI /CF function 
echo "Cif 1:".validate_cif("R6178903")."<br>";

#========================================================
echo "Should be true: ".isNr("123")."<br>";
echo "Should be true: ".isNr("00")."<br>";
echo "Should be false: ".isNr("a1")."<br>============<br>";

echo "Should be true: ".isDate("2008-02-01")."<br>";
echo "Should be false: ".isDate("2008-a2-01")."<br>";
echo "Should be false: ".isDate("2008.02.01")."<br>";
echo "Should be false: ".isDate("2008-00-01")."<br>";
echo "Should be false: ".isDate("2008-01-00")."<br>";
echo "Should be false: ".isDate("0008-01-10")."<br>";
echo "Should be false: ".isDate("3008-10-10")."<br>";
*/
?>